.bg-img(@url){
  background-image: ~'url(@{url}@1x.png)';
  @media only screen and (-Webkit-min-device-pixel-ratio: 1.5), 
  only screen and (-moz-min-device-pixel-ratio: 1.5),
  only screen and (-o-min-device-pixel-ratio: 3/2),
  only screen and (min-device-pixel-ratio: 1.5) {
    background-image: ~'url(@{url}@2x.png)';
  }
  @media only screen and (-Webkit-min-device-pixel-ratio: 2), 
  only screen and (-moz-min-device-pixel-ratio: 2),
  only screen and (-o-min-device-pixel-ratio: 2),
  only screen and (min-device-pixel-ratio: 2) {
    background-image: ~'url(@{url}@2x.png)';
  }
  @media only screen and (-Webkit-min-device-pixel-ratio: 3), 
  only screen and (-moz-min-device-pixel-ratio: 3),
  only screen and (-o-min-device-pixel-ratio: 3),
  only screen and (min-device-pixel-ratio: 3) {
    background-image: ~'url(@{url}@3x.png)';
  }
}
